package club.xyes.zkh.ecommerce.service;

import club.xyes.zkh.ecommerce.commons.entity.Shop;
import club.xyes.zkh.ecommerce.commons.entity.ShopMembershipLevel;

import java.util.List;

/**
 * Create by 郭文梁 2019/4/18 0018 14:40
 * ShopMembershipLevelService
 * 商铺会员等级定义相关业务行为定义
 *
 * @author 郭文梁
 * @data 2019/4/18 0018
 */
public interface ShopMembershipLevelService extends BaseService<ShopMembershipLevel> {
    /**
     * 查找某商户的会员定义信息
     *
     * @param shop 商户
     * @return 等级定义详情
     */
    List<ShopMembershipLevel> findByShop(Shop shop);

    /**
     * 获取指定条件符合商铺会员的最高等级
     *
     * @param shop  商铺
     * @param fee   消费金额
     * @param times 消费次数
     * @return 等级定义
     */
    ShopMembershipLevel highestLevelOfMatching(Shop shop, int fee, int times);

    /**
     * 根据女会员卡ID查询会员等级定义
     *
     * @param membershipId 会员卡ID
     * @return Level List
     */
    List<ShopMembershipLevel> findByMembershipId(Integer membershipId);

    /**
     * 通过会员卡ID和会员等级查询等级信息
     *
     * @param membershipId 会员卡ID
     * @param levelValue   等级
     * @return 会员卡信息
     */
    ShopMembershipLevel findByMembershipIdAndLevel(Integer membershipId, Integer levelValue);
}
